//
//  JMMembersTViewCell.m
//  jiMuOperate
//
//  Created by 胡梅方 on 16/5/3.
//  Copyright © 2016年 jinXinFengLi. All rights reserved.
//

#import "JMMembersTViewCell.h"

@implementation JMMembersTViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createViews];
    }
    return self;
}

-(void)createViews
{
    CGFloat labelX = 0;
    CGFloat nameX = 10;
    CGFloat labelW=100;
    CGFloat labelH = 20;
    UIView *headView = [[UIView alloc]initWithFrame:CGRectMake(labelX, labelX, 320, nameX)];
    self.headView = headView;
    [self addSubview:headView];
    
    
    
    UIImageView *gradeImag= [ARC createImageViewWithFrame:CGRectMake(nameX, labelH, labelH, labelH) ImageName:@"fth"];
    self.gradeImage = gradeImag;
    [self addSubview:gradeImag];
    UILabel *gradeLab = [ARC createLabelWithFrame:CGRectMake(nameX, labelH/2, labelH , labelH/2) Font:10 Text:nil];
    self.gradeNumber = gradeLab;
    [gradeImag addSubview:gradeLab];
    
    UIImageView *personImg = [ARC createImageViewWithFrame:CGRectMake(50, 30, 30, 30) ImageName:@"fth"];
    [self addSubview:personImg];
    self.personImage = personImg;
    
    
    UILabel *nameLab = [ARC createLabelWithFrame:CGRectMake(90, 25, labelW, labelH) Font:14 Text:nil];
    self.nameLabel = nameLab;
    [self addSubview:nameLab];
    
    
    
    
    UILabel *leverL = [ARC createLabelWithFrame:CGRectMake(210, 25, 80, labelH) Font:13 Text:nil];
    self.levelLab = leverL;
    [self addSubview:leverL];

    
    self.headView.frame = [ToolViewAndData MyAutoLayout:headView];
    self.gradeImage.frame = [ToolViewAndData MyAutoLayout:self.gradeImage];
    self.gradeNumber.frame = [ToolViewAndData MyAutoLayout:self.gradeNumber];
    self.nameLabel.frame = [ToolViewAndData MyAutoLayout:self.nameLabel];
     self.levelLab.frame = [ToolViewAndData MyAutoLayout:self.levelLab];
    
    
    self.gradeNumber.textColor = [UIColor whiteColor];
    
    self.nameLabel.textColor = [UIColor blackColor];
    self.headView.backgroundColor = BACKCOLOR;

    self.levelLab.textColor = [UIColor blackColor];
    self.levelNum.textColor = [UIColor redColor];
 
    
    self.nameLabel.textAlignment = NSTextAlignmentLeft;
    self.levelNum.textAlignment = NSTextAlignmentLeft;

}

@end
